import React, { Component } from 'react'
import { Button, } from 'antd'
//import { render } from 'less'
export default class This extends Component {
    constructor(props){
        super(props)
        this.state={
            content:undefined
        }
        this.myFunction= this.myFunction.bind(this)
    }

    handleOnClick=()=>{
        this.setState({content:this})
        console.log('this: ',this)
    }

    myFunction() {
        console.log('this is origin function',this)
    }
    arrowFunction=()=>{
        console.log('this is arrow function',this)
    }
    render(){
        
        return(
            <div style={{textAlign:'center'}}>
                <h3>test the field of this</h3>
                <Button type='primary' onClick={this.myFunction}>Click</Button>
                <p>{`content: ${this.state.content} `}</p>
            </div>
        )
    }


}